package com.hero.herocat;

import com.hero.servlet.HeroRequest;
import com.hero.servlet.HeroResponse;
import com.hero.servlet.HeroServlet;

/**
 * @author XiangXian
 * @version 1.0.0
 * @since 2024/3/31
 */
public class DefaultCustomServlet extends HeroServlet {
    public void doGet(HeroRequest request, HeroResponse response) throws Exception {
        // http://localhost:8080/aaa/bbb/oneservlet?name=xiong
        // path：/aaa/bbb/oneservlet?name=xiong
        String uri = request.getUri();
        String name = uri.substring(0, uri.indexOf("?"));
        response.write("404 - no this servlet : " + name);
    }

    public void doPost(HeroRequest request, HeroResponse response) throws Exception {
        doGet(request, response);
    }
}
